<template>
    <div class="block text-center">
        <span class="demonstration">
        
        </span>
        <el-carousel height="150px">
            <el-carousel-item v-for="item in pictureList" :key="item.id">
                <img :src="item.imgUrl" alt="">
            </el-carousel-item>
        </el-carousel>
  </div>
    
</template>

<style scoped>
*{
    margin: 0;
    padding: 0;
}
.block text-center{
    margin-top: 0;
}
.demonstration {
  color: var(--el-text-color-secondary);
}

.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
img{
    width: 100%;
    height: auto;
    object-fit: cover;
}
</style>

<script setup>
import { getPictureAPI } from '@/apis/home';
import { onMounted,ref } from 'vue';

const pictureList=ref([])

const getPicture=async()=>{
    const res=await getPictureAPI()
    pictureList.value=res.result
}

onMounted(()=>getPicture())

</script>